= div_for @section, :class => @section.custom_class do
  %span.title= @section.translation(I18n.locale)[:title]
  - qs ||= []
  - (questions = @section.questions).each_with_index do |q, i|
    - if q.part_of_group?
      - qs << q # gather up the group questions
      - if (i+1 >= questions.size) or (q.question_group_id != questions[i+1].question_group_id)
        - # this is the last question of the section, or the group
        = render q.question_group.custom_renderer || "/partials/question_group", :g => q.question_group, :qs => qs, :f => f
        - qs = []
    - else # gather up the group questions
      = render q.custom_renderer || "/partials/question", :q => q, :f => f